<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="">
    <input type="hidden" th:value="${role.roleId}" id="roleId" name="roleId">
    角色名字:<input type="text" name="roleName" id="roleName" th:value="${role.roleName}">
    <div class="zTreeDemoBackground left">
        选择权限：
        <ul id="tree" class="ztree"></ul>
    </div>
</form>
<script type="text/javascript">
    $(document).ready(function(){
        var roleId = $("#roleId").val();
        var setting = {
            check: {
                enable: true,
                chkStyle: "checkbox",
                chkboxType: { "Y": "p", "N": "s" }
            },
            async: {
                enable: true,
                url:"/menuController/getCheckedTree/"+roleId,
                autoParam:["id", "name=n", "level=lv"],
                otherParam:{"otherParam":"zTreeAsyncTest"}
            }
        };
        $.fn.zTree.init($("#tree"), setting);
    });
</script>
</body>
</html>